package edu.hawaii.duedates.datastore;

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertSame;
import org.junit.Test;
import java.util.ArrayList;
import java.util.List;
import edu.hawaii.duedates.libraries.ILibrary;
import edu.hawaii.duedates.libraries.UhLibrary;

/**
 * Test the LibraryChoice class.
 * 
 * @author Daniel Arakaki, Jeho Jung, Arthur Shum, Daniel Tian.
 */
public class TestLibraryChoice {

  /**
   * Test the createList() method.
   */
  @Test
  public void testCreateList() {
    List<ILibrary> libList = new ArrayList<ILibrary>();
    libList.add(new UhLibrary());
    List<LibraryChoice> choiceList = LibraryChoice.createList(libList);
    assertFalse("Should not be empty", choiceList.isEmpty());
  }
  /**
   * Test the getter and setter methods.
   */
  @Test
  public void testGettersAndSetters() {
    LibraryChoice choice = new LibraryChoice();
    UhLibrary lib = new UhLibrary();
    int filter = 0;
    choice.setLibrary(lib);
    choice.setFilter(filter);
    assertSame("Should be same", lib, choice.getLibrary());
    assertSame("Should be same", filter, choice.getFilter());
  }
}
